﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Logic;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using HBPVPDruid.Misc;

namespace HBPVPDruid.Spells.Defensives
{
    class Thorns
    {
        public const string SpellName = "Thorns";

        public static bool Pulse()
        {
            // Quick Checks to return false
            if (Battlegrounds.IsInsideBattleground)
            {
                if (Misc.Misc.PVPMisc.MeleeAttackingMe < 2) return false;
            } else {
                if (Misc.Misc.NPCMisc.EnemyAttackingMe < 2) return false;
            }

            if (!SpellManager.CanCast(SpellName)) return false;

            Misc.Misc.CastLog(SpellName);
            SpellManager.Cast(SpellName);
            return true;
        }
    }
}
